﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

///<summary>
///
///</summary>
public class IntroComponent : MonoBehaviour
{
    Animator animator;
   new Animation animation;
    // Start is called before the first frame update
    public void Start()
    {
        animator = GetComponent<Animator>();
        animator.SetBool("IsFinish", true);
        animation = GetComponent<Animation>();
    }
    void Update()
    {
		 AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(0);
		 if (stateInfo.IsName("IntroVanish") && stateInfo.normalizedTime >= 1)
		 {
		     AppFacde.Instance.SendNotification(GameEvents.INTRO_END);
		     gameObject.SetActive(false);
		 }		
	}
	public void BreakSound()
	{
		Debug.Log("播放音效");
			AudioManager.GetInstance.Play("Sounds/balloon/balloon_explosion1");
	}
	public void LoadingEnd()
	{
		AudioManager.GetInstance.Play("Sounds/Intro/nitrome");
	}
}
